package com.example.touch;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.graphics.Canvas;
import android.view.MotionEvent;
import android.view.View;

public class Touch extends View 
{
	private Logic logic;
	
	private List<Screen> screens;
	private Screen activeScreen;
	
	public Touch(Context context)
	{
		super(context);
		
		logic = new Logic();
		Screen.setLogic(logic);
		
		screens = new ArrayList<Screen>();
		// create screen 1 : main menu
		Screen scr1 = new Screen("Main menu");
		scr1.addArea(0, 0, 400, 400, "Area1","doSmth");
		scr1.addArea(0, 400, 400, 400, "Area2");
		// add created screens in the list
		// the first screen will be active
		screens.add(scr1);
		activeScreen = scr1;
		
	}
	public void onDraw(Canvas canvas)
	{
	}
	public boolean onTouchEvent(MotionEvent e)
	{
		activeScreen.onTouch(e);
		return true;
	}
}
